import request from '/@/utils/request'
import {prefix} from '/@/api/supplier/index'

/**
 * 报价单分页数据
 */
export function getQuotePage(params) {
  return request({
    url: prefix + '/quoteOrder/getPage',
    method: 'get',
    params
  })
}

/**
 * 报价单选择器列表
 */
export function quoteSelector() {
  return request({
    url: prefix + '/quoteOrder/quoteSelector',
    method: 'get'
  })
}

/**
 * 创建报价单
 */
export function createQuote(data) {
  return request({
    url: prefix + '/quoteOrder/create',
    method: 'post',
    data
  })
}

/**
 * 编辑报价单
 */
export function editQuote(data) {
  return request({
    url: prefix + '/quoteOrder/edit',
    method: 'post',
    data
  })
}

/**
 * 删除
 */
export function deleteQuote(data) {
  return request({
    url: prefix + '/quoteOrder/delete',
    method: 'post',
    data
  })
}

/**
 * 根据采购订单id获取关联的报价单列表
 */
export function getPurchaseQuotes(purchaseOrderId) {
  return request({
    url: prefix + '/quoteOrder/getQuotesByPurchase?purchaseOrderId=' + purchaseOrderId,
    method: 'get'
  })
}

/**
 * 获取表头设置
 */
export function getHeaders() {
  return request({
    url: prefix + '/quoteOrder/getHeaders',
    method: 'get'
  })
}

/**
 * 保存表头
 */
export function saveHeader(data) {
  return request({
    url: prefix + '/quoteOrder/saveHeader',
    method: 'post',
    data
  })
}

/**
 * 报价单直发
 */
export function sendQuote(data) {
  return request({
    url: prefix + '/quoteOrder/sendQuote',
    method: 'post',
    data
  })
}
